package base;

import com.sun.corba.se.impl.resolver.FileResolverImpl;

import javax.lang.model.SourceVersion;
import java.util.IllegalFormatCodePointException;

/**
 * @program: Dome
 * @description: base
 * @className: DomeThread
 * @author: rjt99999
 * @version: 1.0.0
 * @create: 2020-08-02 00:26
 **/

//继承thread
public class DomeThread extends Thread {


    public DomeThread(String name) {
        super(name);
    }

    //重写父类的run
    @Override
    public void run() {


        for (int i = 0; i < 100; i++) {

            System.out.println(this.getName()+"---"+i);
        }
    }
}

//实现runnable 接口
class DomeRunnable implements Runnable{


    @Override
    public void run() {

        for (int i = 0; i < 100 ; i++) {

                                //返回当前执行线程的引用对象
            System.out.println(Thread.currentThread().getName()+"--"+i);

        }

    }
}
